import Cookie
import os
def getcookie():
    print "Content-type: text/plain\n"
    
    try:
        cookie = Cookie.SimpleCookie(os.environ["HTTP_COOKIE"])
        print "session = " + cookie["session"].value
    except (Cookie.CookieError, KeyError):
        print "session cookie not set!"